<script setup lang="ts">
import { computed, ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { getShopList } from '@/addon/shop_fenxiao/api/fenxiao';
import shopItem from '@/app/pages/rent/components/shopItem.vue';
const shopList = ref();
onShow(() => {
	getShop();
});
const getShop = async () => {
	let address: any = null;
	if (uni.getStorageSync('location_address')) {
		address = uni.getStorageSync('location_address');
	}
	const [longitude, latitude] = address ? [address.longitude, address.latitude] : ['', ''];
	let res: any = await getShopList({ longitude, latitude });
	if (res.data) {
		shopList.value = res.data;
	}
};
</script>
<template>
	<view :style="themeColor()" class="min-h-[100vh] bg-[rgb(247,247,247)] pt-[15rpx] pb-[20rpx] px-[24rpx]">
		<template v-for="(item, index) in shopList" :key="`shop${index}`">
			<shop-item :item="item" />
		</template>
	</view>
</template>
<style lang="scss" scoped></style>
<style lang="scss"></style>
